﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;
using System.Data.Sql;
using System.Data.SqlClient;

namespace Vehicle_Maintenance
{
    class ServiceReminder
    {
        public ServiceReminder() { }
        public string VIN       = string.Empty;
        public string date      = string.Empty;
        public string Odom      = string.Empty;
        public string SerType   = string.Empty;
        public string Months    = string.Empty;

        public void New()
        {
            using (SqlConnection scConnect = new SqlConnection(Properties.Settings.Default.Auto_Log))
            {
                scConnect.Open();
                SqlCommand scCommand  = new SqlCommand();
                scCommand.Connection  = scConnect;
                scCommand.CommandType = CommandType.StoredProcedure;
                scCommand.CommandText = "service_reminders_insert";
                scCommand.Parameters.AddWithValue("@VehicleID", this.VIN);
                scCommand.Parameters.AddWithValue("@Date", this.date);
                scCommand.Parameters.AddWithValue("@Odom", this.Odom);
                scCommand.Parameters.AddWithValue("@Serv_Type", this.SerType);
                scCommand.Parameters.AddWithValue("@Months", this.Months);
                scCommand.ExecuteNonQuery();
                scConnect.Close();
            }
        }

    }
}
